﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Bgm_Project_Expense_Detail.aspx.cs" Inherits="KPIS.GERP.GBMS.APP_UI.Form.Bgm_Project_Expense_Detail" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <link rel="StyleSheet" href="../../Styles/StyleSheet.css" type="text/css">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="pnDetail">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="pnDetail" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <script type="text/javascript">
        function GetRadWindow()
        {
            var oWindow = null;
            if (window.radWindow) oWindow = window.radWindow;
            else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
            return oWindow;
        }
        
        function returnToParent()
        {
            var oArg = new Object();
            var oWnd = GetRadWindow();
            
            oWnd.close(oArg);
        }
        
        function isNumberKey(event)
        {
            var charCode = (event.which) ? event.which : event.keyCode
            if (charCode > 31 && (charCode < 48 || charCode > 57)) {
                return false;
            }
            return true;
        }
    </script>
    <div>
        <asp:Panel ID="pnDetail" runat="server">
            <asp:Label ID="hdReqSeq" runat="server" Text="" Visible="False"></asp:Label>
            <asp:Label ID="hdExpSeq" runat="server" Text="" Visible="False"></asp:Label>
            <input id="hBgmExpGrpSeq" runat="server" type="hidden" />
            <input id="hBgmExpSeq" runat="server" type="hidden" />
            <input id="hBgmProjExpSeq" runat="server" type="hidden" />
            <input id="hProjID" runat="server" type="hidden" />
            <input id="hBgmSourceSeq" runat="server" type="hidden" />
            <input id="hParentIndex" runat="server" type="hidden" />

            
            <asp:Panel ID="Panel1" runat="server" BorderStyle="Groove" BorderWidth="1" BorderColor="Blue" Width="99%">
                <asp:Panel ID="Panel2" runat="server">
                

            <telerik:RadGrid GroupingSettings-CaseSensitive="false" ID="Grid_t9" runat="server" AllowFilteringByColumn="false"
                            AllowMultiRowSelection="True" 
                            AutoGenerateColumns="False" GridLines="None" 
                            MasterTableView-GridLines="None"  Width="99%" Height="150px" OnItemCommand="Grid_t9_ItemCommand">
                            <mastertableview commanditemdisplay="Top" datakeynames="bgm_req_exp_seq" grouploadmode="Client" width="100%" NoDetailRecordsText="... ไม่มีข้อมูล ...">
                            <commanditemtemplate>
                                <table>
                                    <tr>
                                        <td>
                                            <asp:LinkButton ID="Delete_t9" runat="server" CommandName="Delete" CssClass="LinkButton" OnClientClick="javascript:return confirm('ยืนยันการลบข้อมูลที่เลือก')"><img alt="" src="../Image/Grid/Delete.gif" style="border:0px;vertical-align:middle;" />&#160;&#160;ลบข้อมูล</asp:LinkButton>
                                        </td>
                                    </tr>
                                </table>
                            </commanditemtemplate>
                            <rowindicatorcolumn>
                                <HeaderStyle Width="20px" />
                            </rowindicatorcolumn>

                <Columns>
                <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn">
                    <HeaderStyle HorizontalAlign="Center" Width="30px" />
                    <ItemStyle HorizontalAlign="Center" />
                </telerik:GridClientSelectColumn>
                <telerik:GridTemplateColumn Visible="false">
                    <ItemTemplate>
                        <asp:Label ID="lbManagerSeq" runat="server" Text='<%# Eval("bgm_req_exp_seq") %>'></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" />
                </telerik:GridTemplateColumn> 
                <telerik:GridTemplateColumn HeaderStyle-Width="200px" 
                    HeaderStyle-HorizontalAlign="Center" 
                    HeaderText="รายการครุภัณฑ์" 
                    ItemStyle-HorizontalAlign="Left"> 
                    <ItemTemplate>
                        <asp:Label ID="full_name" runat="server" NavigateUrl="#" Text='<%# Eval("icm_res_item_name") %>'></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" />
                </telerik:GridTemplateColumn> 
                
                <telerik:GridBoundColumn AutoPostBackOnFilter="true" 
                    CurrentFilterFunction="Contains" 
                    DataField="unit_qty" 
                    FilterControlWidth="100%" 
                    HeaderText="จำนวน" 
                    ShowFilterIcon="false" 
                    UniqueName="unit_qty" Visible="true">
                    <HeaderStyle HorizontalAlign="Center" />
                    <ItemStyle HorizontalAlign="Left" />
                </telerik:GridBoundColumn>
                
                <telerik:GridBoundColumn AutoPostBackOnFilter="true" 
                    CurrentFilterFunction="Contains" 
                    DataField="unit_price" 
                    FilterControlWidth="100%" 
                    HeaderText="วงเงินต่อหน่วย" 
                    ShowFilterIcon="false" 
                    UniqueName="unit_price" Visible="true">
                    <HeaderStyle HorizontalAlign="Center" />
                    <ItemStyle HorizontalAlign="Right" />
                </telerik:GridBoundColumn>
                
                <telerik:GridBoundColumn AutoPostBackOnFilter="true" 
                    CurrentFilterFunction="Contains" 
                    DataField="total_amount" 
                    FilterControlWidth="100%" 
                    HeaderText="จำนวนเงิน" 
                    ShowFilterIcon="false" 
                    UniqueName="total_amount" Visible="true">
                    <HeaderStyle HorizontalAlign="Center" />
                    <ItemStyle HorizontalAlign="Right" />
                </telerik:GridBoundColumn>
                
                <telerik:GridBoundColumn AutoPostBackOnFilter="true" 
                    CurrentFilterFunction="Contains" 
                    DataField="descr" 
                    FilterControlWidth="100%" 
                    HeaderText="คำชี้แจง" 
                    ShowFilterIcon="false" 
                    UniqueName="descr" Visible="true">
                    <HeaderStyle HorizontalAlign="Center" />
                    <ItemStyle HorizontalAlign="Left" />
                </telerik:GridBoundColumn>
                
                </Columns>
                <editformsettings editformtype="Template">
                <editcolumn uniquename="EditCommandColumn1">
                    </editcolumn></editformsettings>
                </mastertableview>
                <clientsettings enablerowhoverstyle="true">
                    <Scrolling AllowScroll="true" UseStaticHeaders="true" />
                    <clientevents /><selecting allowrowselect="True" />
                </clientsettings>
            </telerik:RadGrid>
                    <table class="defaultTable">
                        <tr>
                            <td width="30%" align="right">
                                รายการครุภัณฑ์ :
                            </td>
                            <td style="padding-left:20px; padding-top:10px">
                                <telerik:RadComboBox ID="ddlResourceItem" runat="server" ZIndex="10000" Width="300px"
                                    DataTextField="icm_res_item_name" DataValueField="icm_res_item_seq" 
                                    AutoPostBack="True" 
                                    onselectedindexchanged="ddlResourceItem_SelectedIndexChanged" ></telerik:RadComboBox>
                            </td>
                        </tr>
                        <tr>
                            <td width="30%" align="right">
                                จำนวน :
                            </td>
                            <td style="padding-left:20px; padding-top:10px">
                                <%--<telerik:RadNumericTextBox ID="txtUnitQty" Runat="server"  MinValue="0"></telerik:RadNumericTextBox>--%>
                                <asp:TextBox ID="txtUnitQty" runat="server" MaxLength="4"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td width="30%" align="right">
                                วงเงินต่อหน่วย :
                            </td>
                            <td style="padding-left:20px; padding-top:10px">
                                <telerik:RadNumericTextBox ID="txtUnitPrice" Runat="server"  MinValue="0"></telerik:RadNumericTextBox>
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
                <asp:Panel ID="Panel3" runat="server">
                    <table class="defaultTable">
                        <tr>
                            <td width="30%" align="right">
                                จำนวนเงิน :
                            </td>
                            <td style="padding-left:20px; padding-top:10px">
                                <telerik:RadNumericTextBox ID="txtTotalAmount" Runat="server"  MinValue="0"></telerik:RadNumericTextBox>
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
                <table class="defaultTable">
                    <tr>
                        <td valign="top" width="30%" align="right">
                            คำชี้แจง :
                        </td>
                        <td style="padding-left:20px; padding-top:10px">
                            <telerik:RadTextBox ID="txtDescr" Runat="server"  TextMode="MultiLine" Height="50" Width="300"></telerik:RadTextBox>
                        </td>
                    </tr>
                </table>
                <table class="defaultTable">
                    <tr>
                        <td valign="top" width="30%" align="right">
                           
                        </td>
                        <td style="padding-left:20px; padding-top:10px">
                            <asp:Button ID="btnPopupSave" runat="server" Text="บันทึก"
                                onclick="btnPopupSave_Click" /><%--OnClientClick="returnToParent()"--%>
                        </td>
                    </tr>
                </table>
                <br />
            </asp:Panel>
        </asp:Panel>
    </div>
    </form>
</body>
</html>
